package com.tensquare.base;

import com.tensquare.util.IdWorker;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.Bean;

/**
 * 基础微服务的引导类
 */
@SpringBootApplication //引导类标记
@EnableDiscoveryClient//服务发现
public class BaseApplication {

    public static void main(String[] args) {
        SpringApplication.run(BaseApplication.class,args);
    }

    //主键生成器
    @Bean
    public IdWorker idWorker(){
        return new IdWorker();
    }
}
